﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QCoreApplication>
#include <opencv2/opencv.hpp>

using namespace cv;
using namespace std;

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

public:
    QString fatherpath=":/image/";
    QImage  q_img;
    cv::Mat m_img;


public:
    void    Loadimg(QString filepath);
    void    Showimg(QImage image);
    QImage  cvMat2QImage(const cv::Mat& mat);
    cv::Mat QImage2cvMat(QImage image);
    int     getnum(Mat image);
    int     getgrey(Mat image,int x,int y);
    bool    cross(Mat image,int x1,int y1,int x2,int y2);

private slots:
    void on_rgb2gray_clicked();
    void on_gray2binary_clicked();
    void on_opening_clicked();
    void on_getoutline_clicked();
    void on_maincode_clicked();
};
#endif // MAINWINDOW_H
